//
//  main.m
//  08_Homework
//
//  Created by dllo on 16/7/13.
//  Copyright © 2016年 LST. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Student.h"
#import "Person.h"
#import "NSMutableArray+Convert.h"
int main(int argc, const char * argv[]) {
    /*
     iOS9新特性三块的深入理解, 创建几个类, 熟悉写法(提交练习成果)
     iOS 类扩展方式的复习
     1> 给NSMutableArray添加convert方法，实现数组倒序。
     */
    Student *stu = [[Student alloc] init];
    stu.name = nil; // nonnull
    stu.sex = @"男"; // nullable
    [stu setArr:nil]; // null_resettable
    NSLog(@"%ld", stu.arr.count);
    // 泛型
    NSMutableArray<NSString *> *array = [NSMutableArray arrayWithObjects:@"123", @"345", nil];
    NSLog(@"%@", array);
    NSMutableDictionary<NSString *, NSString *> *dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"gaoxiao", @"name", nil];
    NSLog(@"%@", dic);
    // 自定义泛型
    Person<Student *> *per = [[Person alloc] init];
    Student *stuPer = [[Student alloc] init];
    stuPer.name = @"asd";
    NSLog(@"%@", per);
    // 协变性
    Student *stuKindOf = [[Student alloc] init];
    NSMutableArray *mutArr = [NSMutableArray array];
    stuKindOf.arr = mutArr;

    
    NSMutableArray *arrMut = [NSMutableArray arrayWithObjects:@"asd", @"abc", @"dsr", nil];
    [arrMut convert:arrMut];
    NSLog(@"%@", arrMut);
    
    return 0;
}
